package com.wiscamp.ninechapters.problems.domain.gateway;

import com.wiscamp.ninechapters.problems.domain.models.problems.problems.ProblemKnowledgePoint;
import com.wiscamp.ninechapters.tags.application.dto.vo.CourseOutlineVO;
import com.wiscamp.ninechapters.tags.application.dto.vo.CourseVO;
import com.wiscamp.ninechapters.tags.domain.models.TagName;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;

import java.util.Collection;

public interface TagGateway {

    // region entity
    long getEntityIdByCode(String entityCode);
    // endregion

    // region knowledge point
    Collection<Long> getChildKnowledgePointIds(@NotEmpty Collection<Long> pointIds);

    Collection<ProblemKnowledgePoint> getKnowledgePointsByProblem(long problemId);

    Collection<Long> getProblemIdsByKnowledgePoints(Collection<Long> pointIds);

    Collection<ProblemKnowledgePoint> getKnowledgePointsByProblems(Collection<Long> problemIds);

    Collection<ProblemKnowledgePoint> getPrimaryKnowledgePointsByProblem(long entityKeyId, boolean isPrimary);
    // endregion

    // region tag
    boolean batchTag(@NotBlank String tagGroupName, @NotBlank String tagName, Collection<Long> problemIds);

    boolean batchUntag(@NotBlank String tagGroupName, @NotBlank String tagName, Collection<Long> problemIds);

    Collection<TagName> getTagNamesByProblem(long problemId);

    TagName getTagByName(String groupName, String tagName);

    Collection<Long> getProblemIdsByTags(Collection<Long> tagIds);
    // endregion

    // region course
    CourseVO getCourse(long courseId);

    CourseOutlineVO getCourseOutline(long courseId, long outlineId);
    // endregion

}
